let arr = [1, 2, 3, 4, 5, 6]

Array.prototype.my_filter = function (cb) {
  let result = []
  for (let i = 0; i < this.length; i++) {
    if (cb(this[i], i, this)) {
      result.push(this[i])
    }
  }
  return result
}

const res = arr.filter((item, index, arr) => {
  // console.log(item, index, arr);
  return item > 3
})

console.log(res);
